﻿@model Sykj.Entity.Channel
@{
    ViewData["Title"] = "添加栏目";
    Layout = "~/Areas/Manager/Views/Shared/_Layout.cshtml";
}
<div class="layui-bgn">
    <form class="layui-form" style="padding: 20px 30px 0 0;">
        <input type="hidden" asp-for="ChannelId">
        <div class="layui-form-item">
            <label class="layui-form-label">栏目模型</label>
            <div class="layui-col-xs9">
                <select name="moduleID" asp-items="@ViewBag.ModuleAll" lay-verify="required"></select>
            </div>
            <div class="layui-tips-danger">
                *必选
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">父级类别</label>
            <div class="layui-col-xs9">
                <select name="ParentId" asp-items="@ViewBag.ChannelAll" lay-verify="required" asp-for="ChannelId"></select>
            </div>
            <div class="layui-tips-danger">
                *必选
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">栏目名称</label>
            <div class="layui-col-xs9">
                <input type="text" name="ChanneName" lay-verify="required" class="layui-input">
            </div>
            <div class="layui-tips-danger">
                *必填
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">栏目描述</label>
            <div class="layui-col-xs9">
                <textarea name="Description" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">关键字</label>
            <div class="layui-col-xs9">
                <input type="text" name="Keywords" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-col-xs9">
                <input type="radio" name="Status" value="0" title="审核通过" checked="">
                <input type="radio" name="Status" value="1" title="作为草稿">
                <input type="radio" name="Status" value="2" title="等待审核">
            </div>
            <div class="layui-tips-danger">
                *必填
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图片</label>
            <div class="layui-col-xs9">
                <input type="text" name="ImageUrl" lay-verify="required" class="layui-input">
            </div>
            <div class="layui-tips-danger">
                *必选
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-col-xs9">
                <textarea name="Remark" class="layui-textarea"></textarea>
            </div>
            <div class="layui-tips-danger">
                *必填
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="add" id="submit" type="button" style="margin-left:15px">提交</button>
                <button id="close" type="button" class="layui-btn layui-btn-primary">关闭</button>
            </div>
        </div>
    </form>
</div>
@section scriptsfeet
        {
    <script type="text/javascript">
        layui.config({
            base: '/layuiadmin/' //自定义模块路径
        }).use(['form', 'layer', 'sykjwh'], function () {
            var $ = layui.$, form = layui.form, sykjwh = layui.sykjwh;

            $("#close").click(function () {
                sykjwh.close();
            });

            form.on('submit(add)', function (obj) {
                //保存
                sykjwh.request('@Url.Action("channeladd", "cms", new { area = Constant.AREAMANAGER })','POST', obj.field, function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                    window.parent.location.href = window.parent.location.href;
                });
            });

        });
    </script>
}
